﻿package makeeasier.utils {
		
	public class Debug {
		
		public static var active:Boolean = false;
		
		public function Debug(){
			
		}
		
		public static function writeLog(str:String):void{
			if(!active){
				return;
			}
			var date:Date = new Date();
			var fr:String = date.fullYear + "-" + zeroFormat(date.month+1,2) + "-" + zeroFormat(date.date,2) + " " + zeroFormat(date.hours,2) + ":" + zeroFormat(date.minutes,2) + ":" + zeroFormat(date.seconds, 2) + ":" + zeroFormat(date.milliseconds,3);
			trace(fr + " | " + str);
		}
		
		public static function zeroFormat(i:int, s:int):String
		{
			var str:String = i.toString();
			for (var ii:int = 0; ii < s-i.toString().length; ii++) {
				str = "0" + str;
			}
			return str;
		}
		
	}
}